package cc.facesign.admin.controller;

import cc.facesign.admin.bean.EmailBean;
import cc.facesign.admin.service.MailService;
import cc.facesign.admin.utils.MqUtils;
import cc.facesign.common.utils.bean.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/email")
@Api(description = "邮件相关")
public class EmailController {

    @Autowired
    private MqUtils mqUtils;

    @Autowired
    private MailService mailService;

    @ApiOperation("发送邮件")
    @PostMapping("/sendEmail")
    public R sendEmail(@RequestBody EmailBean emailBean) {

        mqUtils.sendMail(emailBean);
        return R.ok();
    }
}
